

import 'package:get/get.dart';
import 'package:xreader/common/app_config.dart';
import 'package:xreader/common/http_common.dart';
import 'package:xreader/dto/app_config_vo_entity.dart';
import 'package:xreader/logs/log.dart';
import 'package:xreader/service/book_service.dart';

class InitService {
  static void init() async {
    String appCfgApi = AppConfig.bookAppCfgApi();
    AppConfigVoEntity appConfig = await HttpCommmon.getAppConfig(appCfgApi);
    AppGlobCfg.CHAPTER_CACHE_TMSEC = appConfig.chapterCacheTmsec;
    AppGlobCfg.CONT_CACHE_TMSEC = appConfig.contCacheTmsec;
    Log.i("appCfgApi=$appCfgApi,totalNum=${appConfig.totalNum},totalPage=${appConfig.totalPage} chapterCacheTmsec=${appConfig.chapterCacheTmsec} contCacheTmsec=${appConfig.contCacheTmsec}");
    BookService.initLocalBookInfo(appConfig);
  }
}